//根据采购与Fineline关系校验，关系不存在则报错“请提交当前采购所对应的fineline商品”

var result_108 = JSON.parse('{"CODE":0, "ACTION":"","LEVEL":"", "MSG":"","DATA":"","RULE":"result_108"}');
var jsonbuyers = !isNull(JSON_FINELINE_BUYERS) ? JSON.parse(JSON_FINELINE_BUYERS) : [];


function checkFinelineBuyer(BUYER, jsonbuyers) {
    for (var i = 0; i < jsonbuyers.BUYERS.length; i++) {
        if (BUYER.toLowerCase() == jsonbuyers.BUYERS[i].toLowerCase()) {
            return true;
        }
    }
    return false;
}
if( BUYER.toLowerCase() == 'c5huang'){
    JSON.stringify(result_108);
}
else if(isNull(JSON_FINELINE_BUYERS) ){
    result_108.CODE = 2;
    result_108.ACTION = "CHECKING_REPORT";
    result_108.MSG = "此fineline没有对应的采购";
}
else
if (!checkFinelineBuyer(BUYER, jsonbuyers)
    && BUYER != 'c5huang'
    && CREATOR_TEAM != 'Activation Team'
) {
    result_108.CODE = 2;
    result_108.ACTION = "CHECKING_REPORT";
    result_108.MSG = "请提交当前采购所对应的fineline商品";
}



JSON.stringify(result_108);
